﻿using Butcher.winform.EnterpriseForms.DivisionStorage;
using Butcher.winform.EnterpriseForms.Fatoiles;
using Butcher.winform.EnterpriseForms.MarketWeigh;
using Butcher.winform.EnterpriseForms.MessSalguhterPut;
using Butcher.winform.EnterpriseForms.Partitionees;
using Butcher.winform.EnterpriseForms.productiones;
using Butcher.winform.EnterpriseForms.RBAC;
using Butcher.winform.EnterpriseForms.ReportForm;
using Butcher.winform.EnterpriseForms.SlaughteredDetailnes;
using slaughters;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Butcher.winform.EnterpriseForms
{
    public partial class Main : Form
    {
        /// <summary>
        /// 刷新页面方法
        /// </summary>
        private WebBrowser webBrowser = new WebBrowser();
        /// <summary>
        /// 全局变量
        /// </summary>
        public int c = 0;
        public Main()
        {
            InitializeComponent();
            webBrowser.Dock = DockStyle.Fill;
            this.Controls.Add(webBrowser);
        }
        private void uiNavMenu1_MenuItemClick(TreeNode node, Sunny.UI.NavMenuItem item, int pageIndex)
        {
            var gh = node.Tag;
            c = 0;
            c = Convert.ToInt32(gh);
            //将我们的子窗体进行清除;
            this.HomePage.Controls.Clear();
            //刷新当前网页
            webBrowser.Refresh();
            if (c == 1)
            {
                slaughter slaughter_Add = new slaughter();
                //隐藏组件窗体边框
                slaughter_Add.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                slaughter_Add.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(slaughter_Add);
                //显示企业新增页面
                slaughter_Add.Show();
            }
            if (c == 2)
            {
                SlaughterList sslaughterList_Search = new SlaughterList();
                //隐藏组件窗体边框
                sslaughterList_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                sslaughterList_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(sslaughterList_Search);
                //显示企业列表页面
                sslaughterList_Search.Show();
            }
            if (c == 3)
            {
                Department department_Add = new Department();
                //隐藏组件窗体边框
                department_Add.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                department_Add.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(department_Add);
                //显示企业列表页面
                department_Add.Show();
            }
            if (c == 4)
            {
                Departmentview departmentview_Search = new Departmentview();
                //隐藏组件窗体边框
                departmentview_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                departmentview_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(departmentview_Search);
                //显示企业列表页面
                departmentview_Search.Show();
            }
            if (c == 5)
            {
                Client client_Add = new Client();
                //隐藏组件窗体边框
                client_Add.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                client_Add.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(client_Add);
                //显示企业列表页面
                client_Add.Show();
            }
            if (c == 6)
            {
                SearchClient clientList_Search = new SearchClient();
                //隐藏组件窗体边框
                clientList_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                clientList_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(clientList_Search);
                //显示企业列表页面
                clientList_Search.Show();
            }
            if (c == 7)
            {
                ApproachView approachView_Add = new ApproachView();
                //隐藏组件窗体边框
                approachView_Add.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                approachView_Add.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(approachView_Add);
                //新增进场登记页面
                approachView_Add.Show();
            }
            if (c == 8)
            {
                ApproachList approachlist_search = new ApproachList();
                //隐藏组件窗体边框
                approachlist_search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                approachlist_search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(approachlist_search);
                //进场登记列表页面
                approachlist_search.Show();
            }
            if (c == 9)
            {
                LiveAnimalweighings liveanimalweighings_Add = new LiveAnimalweighings();
                //隐藏组件窗体边框
                liveanimalweighings_Add.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                liveanimalweighings_Add.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(liveanimalweighings_Add);
                //新增活畜称重页面
                liveanimalweighings_Add.Show();
            }
            if (c == 10)
            {
                LiveAnimalweighingList liveanimalweighings_search = new LiveAnimalweighingList();
                //隐藏组件窗体边框
                liveanimalweighings_search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                liveanimalweighings_search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(liveanimalweighings_search);
                //活畜称重列表页面
                liveanimalweighings_search.Show();
            }
            if (c == 11)
            {
                slaughterManage slaughtermanage_search = new slaughterManage();
                //隐藏组件窗体边框
                slaughtermanage_search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                slaughtermanage_search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(slaughtermanage_search);
                //待宰圈管理列表页面
                slaughtermanage_search.Show();
            }
            if (c == 99)
            {
                Scales scales_Add = new Scales();
                //隐藏组件窗体边框
                scales_Add.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                scales_Add.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(scales_Add);
                //磅秤新增页面
                scales_Add.Show();
            }
            if (c == 88)
            {
                ScaleList scalelist_Search = new ScaleList();
                //隐藏组件窗体边框
                scalelist_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                scalelist_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(scalelist_Search);
                //磅秤列表页面
                scalelist_Search.Show();
            }
            if (c == 12)
            {
                Eeduction eeduction_Add = new Eeduction();
                //隐藏组件窗体边框
                eeduction_Add.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                eeduction_Add.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(eeduction_Add);
                //扣减项新增页面
                eeduction_Add.Show();
            }
            if (c == 13)
            {
                DeductionHtml deductionhtml_Search = new DeductionHtml();
                //隐藏组件窗体边框
                deductionhtml_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                deductionhtml_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(deductionhtml_Search);
                //扣减项列表页面
                deductionhtml_Search.Show();
            }
            if (c == 14)
            {
                SlaughteredDetailes slaughteredetailes_Add = new SlaughteredDetailes();
                //隐藏组件窗体边框
                slaughteredetailes_Add.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                slaughteredetailes_Add.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(slaughteredetailes_Add);
                //待宰圈新增页面
                slaughteredetailes_Add.Show();
            }
            if (c == 15)
            {
                SlaughterCircleList slaughtercirclelist_Search = new SlaughterCircleList();
                //隐藏组件窗体边框
                slaughtercirclelist_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                slaughtercirclelist_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(slaughtercirclelist_Search);
                //待宰圈设置列表页面
                slaughtercirclelist_Search.Show();
            }
            if (c == 16)
            {
                ScaleTypeAdd scaletype_Add = new ScaleTypeAdd();
                //隐藏组件窗体边框
                scaletype_Add.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                scaletype_Add.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(scaletype_Add);
                //磅秤类型新增页面
                scaletype_Add.Show();
            }
            if (c == 17)
            {
                MassSlaughter massSlaughter_Add = new MassSlaughter();
                //隐藏组件窗体边框
                massSlaughter_Add.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                massSlaughter_Add.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(massSlaughter_Add);
                //批宰新增页面
                massSlaughter_Add.Show();
            }
            if (c == 18)
            {
                MassSlaughterSearch massSlaughter_Search = new MassSlaughterSearch();
                //隐藏组件窗体边框
                massSlaughter_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                massSlaughter_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(massSlaughter_Search);
                //批宰计划列表页面
                massSlaughter_Search.Show();
            }
            if (c == 19)
            {
                WhiteNote WhiteNode_Add = new WhiteNote();
                //隐藏组件窗体边框
                WhiteNode_Add.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                WhiteNode_Add.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(WhiteNode_Add);
                //白条新增页面
                WhiteNode_Add.Show();
            }
            if (c == 20)
            {
                WhiteNoteList whitenotelist_Search = new WhiteNoteList();
                //隐藏组件窗体边框
                whitenotelist_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                whitenotelist_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(whitenotelist_Search);
                //白条称重列表页面
                whitenotelist_Search.Show();
            }
            if (c == 21)
            {
                TareSetes taresetes_Add = new TareSetes();
                //隐藏组件窗体边框
                taresetes_Add.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                taresetes_Add.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(taresetes_Add);
                //皮重新增页面
                taresetes_Add.Show();
            }
            if (c == 22)
            {
                TareSetList tarsetlist_Search = new TareSetList();
                //隐藏组件窗体边框
                tarsetlist_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                tarsetlist_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(tarsetlist_Search);
                //皮重列表页面
                tarsetlist_Search.Show();

            }
            if (c == 23)
            {
                PartitionAdd partitionadd_Add = new PartitionAdd();
                //隐藏组件窗体边框
                partitionadd_Add.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                partitionadd_Add.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(partitionadd_Add);
                //分割领用新增页面
                partitionadd_Add.Show();
            }
            if (c == 24)
            {
                PartitionList partitionlist_Search = new PartitionList();
                //隐藏组件窗体边框
                partitionlist_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                partitionlist_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(partitionlist_Search);
                //分割领用列表页面
                partitionlist_Search.Show();
            }
            if (c == 31)
            {
                UserAdd useradd_create = new UserAdd();
                //隐藏组件窗体边框
                useradd_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                useradd_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(useradd_create);
                //用户新增页面
                useradd_create.Show();
            }
            if (c == 32)
            {
                RoleCreate roleCreate_create = new RoleCreate();
                //隐藏组件窗体边框
                roleCreate_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                roleCreate_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(roleCreate_create);
                //角色新增页面
                roleCreate_create.Show();
            }
            if (c == 33)
            {
                permissionAdd Permission_create = new permissionAdd();
                //隐藏组件窗体边框
                Permission_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                Permission_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(Permission_create);
                //权限新增新增页面
                Permission_create.Show();
            }
            if (c == 34)
            {
                UserList userlist_Search = new UserList();
                //隐藏组件窗体边框
                userlist_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                userlist_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(userlist_Search);
                //用户列表页面
                userlist_Search.Show();
            }
            if (c == 35)
            {
                RoleList rolelist_Search = new RoleList();
                //隐藏组件窗体边框
                rolelist_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                rolelist_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(rolelist_Search);
                //角色列表页面
                rolelist_Search.Show();
            }
            if (c == 36)
            {
                permissionList partitionlist_Search = new permissionList();
                //隐藏组件窗体边框
                partitionlist_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                partitionlist_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(partitionlist_Search);
                //权限列表列表页面
                partitionlist_Search.Show();
            }
            if(c == 25)
            {
                FatoilList fatoillist_create = new FatoilList();
                //隐藏组件窗体边框
                fatoillist_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                fatoillist_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(fatoillist_create);
                //膘油称重新增页面
                fatoillist_create.Show();
            }
            if(c == 26)
            {
                FatoilAdd fatoilladd_Search = new FatoilAdd();
                //隐藏组件窗体边框
                fatoilladd_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                fatoilladd_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(fatoilladd_Search);
                //膘油称重表列页面
                fatoilladd_Search.Show();
            }
            if(c == 27)
            {
                productionAdd production_create = new productionAdd();
                //隐藏组件窗体边框
                production_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                production_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(production_create);
                //生产化膘单新增页面
                production_create.Show();
            }
            if(c == 28)
            {
                productionList production_Search = new productionList();
                //隐藏组件窗体边框
                production_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                production_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(production_Search);
                //生产化膘单列页面
                production_Search.Show();
            }
            if( c == 29)
            {
                DivisionStorageAdd division_create = new DivisionStorageAdd();
                //隐藏组件窗体边框
                division_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                division_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(division_create);
                //分割入库称重新增页面
                division_create.Show();
            }
            if(c == 30)
            {
                DivisionListForm division_Search = new DivisionListForm();
                //隐藏组件窗体边框
                division_Search.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                division_Search.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(division_Search);
                //分割入口称重列表页面
                division_Search.Show();
            }
            if(c == 41)
            {
                MarketWeighAdd market_create = new MarketWeighAdd();
                //隐藏组件窗体边框
                market_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                market_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(market_create);
                //销售称重新增页面
                market_create.Show();
            }
            if(c == 42)
            {
                

            }
            if(c == 43) 
            {
                DetailTableofSplitGoods detail_create = new DetailTableofSplitGoods();
                //隐藏组件窗体边框
                detail_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                detail_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(detail_create);
                //分割入库明细页面
                detail_create.Show();
            }
            if (c==44)
            {
                InventoryReceiving inventory_create = new InventoryReceiving();
                //隐藏组件窗体边框
                inventory_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                inventory_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(inventory_create);
                //分割入库汇总页面
                inventory_create.Show();
            }
            if (c == 45)
            {
                RegistrationDetailsForEntry registration_create = new RegistrationDetailsForEntry();
                //隐藏组件窗体边框
                registration_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                registration_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(registration_create);
                //进场登记明细页面
                registration_create.Show();
            }
            if(c == 46)
            {
                WhiteStripWeighingSchedule whitestrip_create = new WhiteStripWeighingSchedule();
                //隐藏组件窗体边框
                whitestrip_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                whitestrip_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(whitestrip_create);
                //白条称重明细页面
                whitestrip_create.Show();
            }
            if(c == 47)
            {
                SummarySheetOfWhiteBarWeighing summary_create = new SummarySheetOfWhiteBarWeighing();
                //隐藏组件窗体边框
                summary_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                summary_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(summary_create);
                //白条称重汇总页面
                summary_create.Show();
            }
            if(c == 48)
            {
                SalesSchedule sales_create = new SalesSchedule();
                //隐藏组件窗体边框
                sales_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                sales_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(sales_create);
                //销售称重明细页面
                sales_create.Show();
            }
            if(c == 49)
            {
                SalesSummarySheet salessummary_create = new SalesSummarySheet();
                //隐藏组件窗体边框
                salessummary_create.FormBorderStyle = FormBorderStyle.None;
                //知识子非顶级窗体
                salessummary_create.TopLevel = false;
                //将子窗体载入panel
                this.HomePage.Controls.Add(salessummary_create);
                //销售称重汇总页面
                salessummary_create.Show();
            }
        }
        private void HomePage_Paint(object sender, PaintEventArgs e)
        {
        }
    }
}
